<style>

.statistik_ahli{
	background:#fff; 
	border-width:2px; 
	border-style:solid; 
	padding:10px; 
	border-color:#cecece;
	-moz-border-radius: 8px; 
}

.statistik_ahli thead th {
	font-size: 14px;
	font-weight: bold;
	background: #f7f7f7;
	height: 30px;
}

.statistik_ahli legend{
	font-weight: bold;
	font-size: 24px;
}

.statistik_ahli table {
	/* border: solid 1px; */
	border-spacing: 2px;
	border-collapse: collapse;	
	-moz-border-radius: 8px; 

}

.statistik_ahli th {
	text-align: center;
	font-weight: bold;
	border: solid 1px;
}

.statistik_ahli tr:hover>td {
	background-color: #e1eafe;
}

.statistik_ahli td{
	text-align: center;
	border: solid 1px;
	width: 8%;
	height: 25px;
	 padding: 2px;
}
.statistik_ahli .tajuk-jawatan{
	text-align: left;
	width: 30%;
}


</style>
<fieldset class="statistik_ahli">
<legend>Statistik Ahli Aktif Sehinga <?php echo date("d.m.Y") ?></legend>
<table width="100%">
  <thead>
    <tr>
	  <th class="tajuk-jawatan" rowspan="7"></th>
	  <th colspan="4">Lelaki (<?php echo $jumlah_lelaki ?>)</th>
	  <th colspan="4">Perempuan (<?php echo $jumlah_perempuan ?>)</th>
	</tr>
    <tr>
	  <!--td></td-->
	  <?php foreach($bangsa_rpt as $bangsa): ?>
		<th colspan="2"><?php echo $bangsa ?></th>
	  <?php endforeach; ?>
	</tr>
    <tr>
	  <!--td></td-->
	  <th>L</th>
	  <th>P</th>
	  <th>L</th>
	  <th>P</th>
	  <th>L</th>
	  <th>P</th>
	  <th>L</th>
	  <th>P</th>
	</tr>
  </thead>
  <!-- Data start -->
    <tr>
	  <th class="tajuk-jawatan"></td>
	  <th><?php echo $data_kaum_jantina['Melayu']['Lelaki'] 	?></th>
	  <th><?php echo $data_kaum_jantina['Melayu']['Perempuan'] 	?></th>
	  <th><?php echo $data_kaum_jantina['Cina']['Lelaki'] 		?></th>
	  <th><?php echo $data_kaum_jantina['Cina']['Perempuan'] 		?></th>
	  <th><?php echo $data_kaum_jantina['India']['Lelaki'] 		?></th>
	  <th><?php echo $data_kaum_jantina['India']['Perempuan'] 	?></th>
	  <th><?php echo $data_kaum_jantina['Lain-lain']['Lelaki'] 	?></th>
	  <th><?php echo $data_kaum_jantina['Lain-lain']['Perempuan']?></th>
	</tr>
  
<?php foreach($data as $id=>$dat): ?>
  <tr>
	  <td class="tajuk-jawatan"><?php echo $id ?></td>
	  <td><?php echo !is_null($dat['Melayu']['Lelaki']) ? $dat['Melayu']['Lelaki'] : '-';		?></td>
	  <td><?php echo !is_null($dat['Melayu']['Perempuan']) ? $dat['Melayu']['Perempuan'] : '-'; 	?></td>
	  <td><?php echo !is_null($dat['Cina']['Lelaki']) ? $dat['Cina']['Lelaki'] : '-'; 			?></td>
	  <td><?php echo !is_null($dat['Cina']['Perempuan']) ? $dat['Cina']['Perempuan'] : '-'; 		?></td>
	  <td><?php echo !is_null($dat['India']['Lelaki']) ? $dat['India']['Lelaki'] : '-'; 			?></td>
	  <td><?php echo !is_null($dat['India']['Perempuan']) ? $dat['India']['Perempuan'] : '-'; 	?></td>
	  <td><?php echo !is_null($dat['Lain-lain']['Lelaki']) ? $dat['Lain-lain']['Lelaki'] : '-'; 	?></td>
	  <td><?php echo !is_null($dat['Lain-lain']['Perempuan']) ? $dat['Lain-lain']['Perempuan'] : '-'; ?></td>
	</tr>
<?php endforeach; ?>	
</table>

</fieldset>